/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package radio.sessions;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import radio.entities.PaymentRate;

/**
 *
 * @author Huu Vinh
 */
@Stateless
public class PaymentRateFacade extends AbstractFacade<PaymentRate> {
    @PersistenceContext(unitName = "RadioCabsEJB-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public PaymentRateFacade() {
        super(PaymentRate.class);
    }

    public PaymentRate findid(String name, int date) {
        PaymentRate pr=(PaymentRate) em.createNamedQuery("PaymentRate.findId").setParameter("paymentName", name).setParameter("noDate", date).getResultList().get(0);     
          return pr;
    }
    
}
